<?php
defined( '_JEXEC' ) or die( 'Restricted access' );
$template = $this->template;
$js_path = 'templates/'.$template.'/js/';
$css_path = 'templates/'.$template.'/css/';
$sifr_css = 'sifr/css/';
$sifr_js = 'sifr/js/';
$sifr_flash = 'sifr/flash/';

// THIS REMOVES MOOTOOLS 1.11 FROM BEING CALLED IN THE HEADER INFO

//$headerstuff = $this->getHeadData();
//$key = JURI::base( true ) . '/media/system/js/mootools.js';
//unset( $headerstuff['scripts'][$key] );
//$key = JURI::base( true ). '/media/system/js/caption.js';
//unset( $headerstuff['scripts'][$key] );
//$this->setHeadData($headerstuff);

////get the headdata
//$headerstuff = $this->getHeadData();
//// (part of) the filenames to be removed
//// 'mootools' will find 'mootools.js' and 'mootools-uncompressed.js'
//$search = array('mootools', 'caption.js', 'joomla.javascript.js');
//
//// remove the js mootools files
//foreach($headerstuff['scripts'] as $key => $script) {
//    foreach($search as $findme) {
//        if(stristr($key, $findme) !== false) {
//            unset($headerstuff['scripts'][$key]);
//        }
//    }
//}
//// restore
//$this->setHeadData($headerstuff);
//
//// restore
//$this->setHeadData($headerstuff);
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language;?>" lang="<?php echo $this->language; ?>" >

<head>
	<jdoc:include type="head" />
	<?php 
		JDocument::addScript( $js_path.'resolution.js', "text/Javascript" );
		JDocument::addScript( $sifr_js.'sifr.js', "text/Javascript" );
		JDocument::addScript( $sifr_js.'sifr-config.js', 'text/Javascript' );
		JHTML::_('behavior.mootools');
		
	?>
	
	<script language = "Javascript">
		<!--
			checkCookie();
		-->
	</script>
	
	
    <?php
    	// The resolution cookie is set in javascript and set in php JUST IN CASE there is a future need for it
		if( isset( $_COOKIE["users_resolution"] ) && isset( $_COOKIE["users_width"] ) )
		{
			$res = $_COOKIE["users_resolution"];
			$width = $_COOKIE["users_width"];
			$width = (integer) $width;
			if( $width == 800 )
				JHTML::stylesheet( 'littlebig800.css', $css_path );
			else
				JHTML::stylesheet( 'littlebig.css', $css_path );
		}

	?>
	<link rel = "stylesheet" type = "text/css" href = "sifr/css/sIFR-print.css" media = "print" />
	<link rel = "stylesheet" type = "text/css" href = "sifr/css/sIFR-screen.css" media = "screen" />
	<!--[if lte IE 7.0]>
		<link rel = "stylesheet" type = "text/css" href = "templates/<?php echo $template; ?>/css/littlebigie7.css" /> 
	<![endif]-->
	

</head>

<body>
	
	<div id = "header">
	
		<div id = "image_bar">
			<a href = "./index.php">
				<img src = "templates/<?php echo $this->template ?>/images/bpsmallheader.png" alt = "header image" />
			</a>
			<p id = "support"><a href = "#">Need help?</a></p>

		</div>
		
		<div id = "menu_bar_wrap">
			<div id = "menu_bar">
		
				  <img class = "right_corner"
					 src = "templates/<?php echo $this->template ?>/images/menucornerright.png" alt = "right corner" />
				 
				  <img class = "left_corner"
					 src = "templates/<?php echo $this->template ?>/images/menucornerleft.png" alt = "left corner" />
					 
				  <jdoc:include type="modules" name="top" style="xhtml" />
				 
				<!--<div id = "menu_list_wrap">
					<ul id = "main_menu">
						<li class = "menu"><a href = "#">Home</a></li>
						<li class = "menu"><a href = "#">BookKids</a></li>
						<li class = "menu"><a href = "#">Events</a></li>
						<li class = "menu"><a href = "#">Gifts</a></li>
						<li class = "last"><a href = "#">Camps</a></li>
					</ul>
				</div>
			
			--></div>
		</div>
	</div>

	<div id = "content_box">

		<div id = "search_bar_wrap">
			<!-- <img class = "right_corner" src = "templates/<?php echo $this->template ?>/images/searchbarright.png"
				alt = "right search bar corner" /> -->
				
			<!-- <img class = "left_corner" src = "templates/<?php echo $this->template ?>/images/searchbarleft.png"
				alt = "left search bar corner" /> -->
				
			<div id = "search_bar">
			<? // @TODO Make the sign-up form into its own module ?>
				<div id = "newsletter_form">
				
					<form name="ccoptin" action="http://ui.constantcontact.com/d.jsp" target="_blank" method="post">
						<div id = "sign_up">
							<input id = "signup_button" type = "image" src = "images/signup_button.png" 
								name = "submit" alt = "signup button" />
							<input type="text" id = "ea" name="ea" size="22" value="Sign up for our newsletter!" />
							<input type="hidden" name="m" value="1101361817415" />
							<input type="hidden" name="p" value="oi" />
						</div>
					</form>
					
				</div>
				
				<jdoc:include type="modules" name="search" style="xhtml" />
				
				<?php echo date('l, F j'); ?>
			</div>
		
		</div>
		
		<div class = "clear"></div>
		
		
		<div id = "left_col">
		
			<div id = "bp_news">
				<h3 class = "title">News &amp; Announcements</h3>
				<div class = "inner">
					<jdoc:include type="modules" name="left1" style="xhtml" />
				</div>
			</div>
			
			<div id = "bp_recommends">
				<h3 class = "title">BookPeople Recommends</h3>
				<div class = "inner">
					<jdoc:include type="modules" name="left2" style="xhtml" />
				</div>
			</div>
	
		</div>
		
		<div id = "right_box">
		
		<jdoc:include type="component" />
		
		<?php if( $this->countModules('main') && $this->countModules('mainbl and mainbr') ): ?>
			<div id = "coming_up">
				<h1 class = "title">Coming Up at BookPeople</h1>
				<div class = "inner">
					<jdoc:include type="modules" name="main" style="xhtml" />
				</div>
			</div>
			
			<div id = "bp_community">
				<h3 class = "title">BookPeople in the Community</h3>
				<div class = "inner">
					<jdoc:include type="modules" name="mainbr" style="xhtml" />
				</div>
			</div>
			
			<div id = "bp_blog">
				<h3 class = "title">BookPeople Blog</h3>
				<div class = "inner">
					<jdoc:include type="modules" name="mainbl" style="xhtml" />
				</div>
			</div>
		<?php endif; ?>
		
		</div>	
		
		<div class = "clear"></div>	
	</div>
	
	<div id = "footer">
	
		<div id = "footer_list_wrap">
		
			<ul id = "footer_menu">
				<li><a href = "#">Home</a></li>
				<li><a href = "#">BookKids</a></li>
				<li><a href = "#">Events</a></li>
				<li><a href = "#">Gifts</a></li>
				<li><a href = "#">Camps</a></li>
				<li class = "foot"><a href = "#">Support</a></li>
			</ul>
		
		</div>
		
		<span>&copy; BookPeople 2008</span>
		
		<div class = "clear"></div>
	
	</div>
	
</body>

</html>